package business;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import util.JdbcUtils;

public class RegisterBusiness {
	public boolean register(String username, String password,int state){
		JdbcUtils jdbcUtils=new JdbcUtils();
		boolean flag = false;
		Connection conn = null;
		PreparedStatement prep = null;
		try{
			conn = jdbcUtils.getConnection();
			prep = conn.prepareStatement("insert into user(name,password,state) values(?,?,?);");
			prep.setString(1, username);
			prep.setString(2, password);
			prep.setInt(3, state);
			prep.executeUpdate();
			flag=true;
			
	
		}catch(SQLException e){
			e.printStackTrace();
			
		}
		
		return flag;
		
	}
}
